package com.zwb.demo.easyweb.modules.database.entity;

import com.zwb.demo.easyweb.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 数据库表
 */
@Data
@Table(name = "t_database_table")
@EqualsAndHashCode(callSuper = true)
@Entity
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
public class DatabaseTablePO extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(name = "id", insertable = false, nullable = false, length = 32)
    private String id;

    /**
     * 表名
     */
    @Column(name = "table_name", nullable = false)
    private String tableName;

    /**
     * 主键策略
     */
    @Column(name = "generation_strategy", nullable = false)
    private Integer generationStrategy;

    /**
     * 表类型
     */
    @Column(name = "table_type")
    private String tableType;

    /**
     * 表id类型
     */
    @Column(name = "id_type")
    private String idType;

    /**
     * 数据库id
     */
    @Column(name = "database_id", nullable = false)
    private String databaseId;

    /**
     * 表描述
     */
    @Column(name = "table_desc")
    private String tableDesc;

    /**
     * 类名
     */
    @Column(name = "class_name")
    private String className;

    /**
     * 主表id
     */
    @Column(name = "leader_table_id")
    private String leaderTableId;

    /**
     * 同步状态
     */
    @Column(name = "sync_state")
    private String syncState;

    
}